/* ==========================================================================
   Adyasha Newspaper — admin dashboard
   ========================================================================== */

:root {
  --a-brand:   #c8102e;
  --a-brand-d: #9b0c23;
  --a-side:    #141b26;
  --a-side-2:  #1d2735;
  --a-ink:     #17202c;
  --a-ink-2:   #4a5666;
  --a-ink-3:   #7b8798;
  --a-line:    #e3e8ef;
  --a-bg:      #f4f6f9;
  --a-card:    #ffffff;
  --a-ok:      #16a34a;
  --a-warn:    #d97706;
  --a-info:    #2563eb;
  --a-danger:  #dc2626;
  --a-radius:  10px;
  --a-shadow:  0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.05);
  --a-shadow-l:0 8px 24px rgba(16,24,40,.10);
  --sidebar-w: 258px;
  --font-or:   'Noto Sans Oriya', 'Nirmala UI', system-ui, sans-serif;
}

[data-theme="dark"] {
  --a-ink:   #e6eaf1;
  --a-ink-2: #aeb9c8;
  --a-ink-3: #7e8a9c;
  --a-line:  #2b3442;
  --a-bg:    #0f141c;
  --a-card:  #161d27;
  --a-side:  #0a0f16;
  --a-side-2:#141c27;
  --a-shadow:0 1px 3px rgba(0,0,0,.45);
  --a-shadow-l:0 8px 24px rgba(0,0,0,.55);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-or);
  background: var(--a-bg);
  color: var(--a-ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --------------------------------------------------------------- login --- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #c8102e 0%, #6d0a1c 55%, #1a1f2b 100%);
}
.login-card {
  width: min(420px, 100%);
  background: var(--a-card);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 34px 30px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { width: auto; max-width: 260px; height: auto; margin: 0 auto 14px; }
.login-logo h1 { color: var(--a-brand); font-size: 27px; margin: 0 0 4px; font-weight: 800; }
.login-logo p { color: var(--a-ink-3); font-size: 13.5px; margin: 0; }
.login-hint {
  margin-top: 18px;
  padding: 11px 13px;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.25);
  border-radius: var(--a-radius);
  font-size: 12.5px;
  color: var(--a-ink-2);
  line-height: 1.7;
}

/* ------------------------------------------------------------- sidebar --- */

.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--a-side);
  color: #c3ccd9;
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 50;
  transition: transform .26s ease;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #33405232; border-radius: 3px; }

.sb-brand {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 11px;
}
.sb-logo { width: 100%; max-width: 190px; height: auto; flex-shrink: 0; }
.sb-brand h2 { color: #fff; font-size: 19px; margin: 0; font-weight: 800; }
.sb-brand span { font-size: 11.5px; color: #8494a8; letter-spacing: 1.4px; text-transform: uppercase; }

.sb-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--a-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-name { color: #fff; font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.sb-user-role { font-size: 12px; color: #8494a8; }

.sb-section {
  padding: 16px 22px 7px;
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #63728a;
  font-weight: 700;
}
.sb-nav { list-style: none; margin: 0; padding: 0 10px; }
.sb-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 550;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sb-nav a:hover { background: var(--a-side-2); color: #fff; }
.sb-nav a.is-active { background: var(--a-brand); color: #fff; }
.sb-nav svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; opacity: .9; }
.sb-badge {
  margin-right: auto;
  background: var(--a-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.sb-nav a.is-active .sb-badge { background: rgba(255,255,255,.28); }

/* ----------------------------------------------------------------- top --- */

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--a-card);
  border-bottom: 1px solid var(--a-line);
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--a-line);
  background: var(--a-card);
  color: var(--a-ink-2);
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--a-brand); color: var(--a-brand); }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }

.burger { display: none; }

.admin-content { padding: 24px 26px 44px; flex: 1; }

/* ---------------------------------------------------------------- cards -- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--a-card);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--a-shadow);
  transition: transform .18s, box-shadow .18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--a-shadow-l); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; fill: #fff; }
.stat-value { font-size: 25px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 13.5px; color: var(--a-ink-3); }

.bg-brand { background: var(--a-brand); }
.bg-ok    { background: var(--a-ok); }
.bg-warn  { background: var(--a-warn); }
.bg-info  { background: var(--a-info); }
.bg-purple{ background: #7c3aed; }
.bg-teal  { background: #0d9488; }

.panel {
  background: var(--a-card);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--a-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.split-2-1 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 22px; }

/* ---------------------------------------------------------------- table -- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  background: var(--a-bg);
  text-align: right;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--a-ink-2);
  border-bottom: 1px solid var(--a-line);
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--a-line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--a-bg); }
.cell-title { font-weight: 600; max-width: 400px; }
.cell-title small { display: block; color: var(--a-ink-3); font-weight: 400; font-size: 12.5px; }
.thumb-sm {
  width: 56px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--a-bg);
}
.nowrap { white-space: nowrap; }
.text-muted { color: var(--a-ink-3); font-size: 13px; }

/* --------------------------------------------------------------- pills --- */

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-published { background: #dcfce7; color: #14532d; }
.pill-draft     { background: #e5e7eb; color: #374151; }
.pill-pending   { background: #fef3c7; color: #78350f; }
.pill-approved  { background: #dcfce7; color: #14532d; }
.pill-spam      { background: #fee2e2; color: #7f1d1d; }
.pill-admin     { background: #ede9fe; color: #4c1d95; }
.pill-editor    { background: #dbeafe; color: #1e3a8a; }
.pill-reporter  { background: #f1f5f9; color: #334155; }
.pill-on        { background: #dcfce7; color: #14532d; }
.pill-off       { background: #fee2e2; color: #7f1d1d; }
[data-theme="dark"] .pill-published,[data-theme="dark"] .pill-approved,[data-theme="dark"] .pill-on { background:#123021; color:#7ee2a8; }
[data-theme="dark"] .pill-draft,[data-theme="dark"] .pill-reporter { background:#232c39; color:#b6c1d1; }
[data-theme="dark"] .pill-pending { background:#3a2c0e; color:#fcd34d; }
[data-theme="dark"] .pill-spam,[data-theme="dark"] .pill-off { background:#3a1417; color:#fca5a5; }
[data-theme="dark"] .pill-admin { background:#2a1f4d; color:#c4b5fd; }
[data-theme="dark"] .pill-editor { background:#132747; color:#93c5fd; }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn-primary { background: var(--a-brand); color: #fff; }
.btn-primary:hover { background: var(--a-brand-d); }
.btn-outline { background: var(--a-card); border-color: var(--a-line); color: var(--a-ink-2); }
.btn-outline:hover { border-color: var(--a-brand); color: var(--a-brand); }
.btn-danger { background: var(--a-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--a-ok); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------- forms --- */

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--a-ink-2);
}
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=number], .field input[type=url],
.field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--a-line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  background: var(--a-card);
  color: var(--a-ink);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--a-brand);
  box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}
.field .hint { font-size: 12.5px; color: var(--a-ink-3); margin-top: 5px; }

.check-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.check-row input { width: 17px; height: 17px; accent-color: var(--a-brand); cursor: pointer; }
.check-row label { margin: 0; cursor: pointer; font-weight: 550; }

.file-drop {
  border: 2px dashed var(--a-line);
  border-radius: var(--a-radius);
  padding: 22px;
  text-align: center;
  color: var(--a-ink-3);
  cursor: pointer;
  transition: all .15s;
}
.file-drop:hover { border-color: var(--a-brand); color: var(--a-brand); }
.file-drop input { display: none; }
.file-drop svg { width: 30px; height: 30px; fill: currentColor; margin-bottom: 7px; }
.preview-img {
  margin-top: 12px;
  max-height: 190px;
  border-radius: 8px;
  border: 1px solid var(--a-line);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--a-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--a-bg);
}
.editor-toolbar button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--a-ink-2);
  transition: all .13s;
}
.editor-toolbar button:hover { background: var(--a-card); border-color: var(--a-line); color: var(--a-brand); }
.editor-area {
  min-height: 320px;
  max-height: 620px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--a-line);
  border-radius: 0 0 8px 8px;
  background: var(--a-card);
  font-size: 15.5px;
  line-height: 1.85;
}
.editor-area:focus { outline: none; border-color: var(--a-brand); }
.editor-area p { margin: 0 0 14px; }
.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--a-ink-3);
}

/* -------------------------------------------------------------- alerts --- */

.alert {
  padding: 12px 15px;
  border-radius: var(--a-radius);
  margin-bottom: 16px;
  font-size: 14.5px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 9px;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
[data-theme="dark"] .alert-success { background:#0d2b1e; color:#6ee7b7; }
[data-theme="dark"] .alert-error   { background:#2c1214; color:#fca5a5; }
[data-theme="dark"] .alert-info    { background:#111f36; color:#93c5fd; }

/* --------------------------------------------------------------- chart --- */

.chart-wrap { position: relative; height: 260px; }

.bar-chart { display: flex; align-items: flex-end; gap: 7px; height: 210px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar {
  width: 100%;
  background: linear-gradient(180deg, var(--a-brand), #e2536b);
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  position: relative;
  transition: opacity .15s;
}
.bar:hover { opacity: .8; }
.bar-label { font-size: 11px; color: var(--a-ink-3); white-space: nowrap; }
.bar-value { font-size: 11.5px; font-weight: 700; color: var(--a-ink-2); }

/* -------------------------------------------------------- misc / lists --- */

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--a-line);
  align-items: center;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.mini-list .t { font-size: 14px; font-weight: 600; line-height: 1.45; }
.mini-list .m { font-size: 12.5px; color: var(--a-ink-3); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 18px;
  background: var(--a-card);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius);
  padding: 14px 16px;
}
.filter-bar .field { margin: 0; min-width: 150px; }

.pagination { display: flex; gap: 5px; justify-content: center; padding: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px;
  padding: 0 11px;
  display: grid;
  place-items: center;
  border: 1px solid var(--a-line);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  background: var(--a-card);
}
.pagination a:hover { border-color: var(--a-brand); color: var(--a-brand); }
.pagination .is-active { background: var(--a-brand); color: #fff; border-color: var(--a-brand); }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--a-ink-3);
}
.empty svg { width: 46px; height: 46px; fill: currentColor; opacity: .3; margin-bottom: 12px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 45;
}
.sidebar-backdrop.is-open { display: block; }

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 1100px) {
  .split-2-1, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .burger { display: grid; }
  .grid-2, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .admin-content { padding: 18px 15px 40px; }
  .topbar { padding: 11px 15px; }
  .topbar h1 { font-size: 17px; }
}

/* Wide wordmark: stack it above the "Admin Panel" label. */
.sb-brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.sb-brand.has-logo span { font-size: 11.5px; color: #8494a8; letter-spacing: 1.4px; text-transform: uppercase; }
